package net.code.btalk;

import net.code.btalk.ui.MessageScreen;

public class Buddy {
	public static BTalk btalk;
	
	public String jid;
	public String name;
	public int 	status;
	public boolean unread;
	
	//public MessageListField msgList;
	//public MessageRichTextField msgField;
	
	public MessageScreen msgScreen;
	
	public Buddy(String id, String n, int s) {
		if (n == null)
			this.name = id;
		else 
			this.name = n;
		this.jid = id;
		this.status = s;
	}
	
	/*public MessageListField getMsgList() {
		if (msgList == null)
			msgList = new MessageListField();
		return msgList;
	}*/
	
	public void sendMessage(String msg) {
		msgScreen.sendMessage(msg);		
	}
	
	public void receiveMessage(String msg, boolean current) {
		this.getMsgScreen().receiveMessage(msg, current);
		
	}
	
	public MessageScreen getMsgScreen() {
		if (msgScreen == null)
			msgScreen = new MessageScreen(this);
		return msgScreen;
	}
	
	// TODO message list

	// status value
	public static final int STATUS_OFFLINE 	= 0x00000000;
	public static final int STATUS_AWAY 	= 0x00000001;
	public static final int STATUS_BUSY 	= 0x00000002;
	public static final int STATUS_ONLINE 	= 0x00000003;
}
